function mobile_check_field( pos )

    global mobile_AN_Map;       % mapa aktywnych czujnikow w kazdym obszarze
    global S_Map;
    
    pos = pos +1;
    
    while (mobile_AN_Map(pos(1),pos(2),2)~=0 && S_Map(mobile_AN_Map(pos(1),pos(2),2),3)<5)
        mobile_AN_Map(pos(1),pos(2),2) = mobile_AN_Map(pos(1),pos(2),mobile_AN_Map(pos(1),pos(2),1));
        mobile_AN_Map(pos(1),pos(2),mobile_AN_Map(pos(1),pos(2),1)) = 0;
        mobile_AN_Map(pos(1),pos(2),1) = mobile_AN_Map(pos(1),pos(2),1)-1;
    end
end

